from django.shortcuts import render

from rest_framework import generics

from update_app.models import Update
from update_app.serializer import UpdateSerializer,UpdateDetailSerializer

# Create your views here.
class UpdateView(generics.ListAPIView):
    queryset = Update.objects.all().order_by('-create_time')
    serializer_class = UpdateSerializer

#获取单个课程的详细信息
class UpdateDetailView(generics.RetrieveAPIView):
    queryset = Update.objects.all()
    serializer_class = UpdateDetailSerializer
